home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWGXUtil.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.4 KB  |  122 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWGXUtil.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWGXUTIL_H
  11. #define FWGXUTIL_H
  12.  
  13. #ifndef FWGXCFG_H
  14. #include "FWGXCfg.h"
  15. #endif
  16.  
  17. #ifdef FW_SUPPORT_GX        // This file is only for QuickDraw GX
  18.  
  19. #ifndef FWSTDDEF_H
  20. #include "FWStdDef.h"
  21. #endif
  22.  
  23. #ifndef FWEXCDEF_H
  24. #include "FWExcDef.h"
  25. #endif
  26.  
  27. #ifdef FWODEXCE_H
  28. #include "FWODExce.h"
  29. #endif
  30.  
  31. #ifndef __GXTYPES__
  32. #include <GXTypes.h>
  33. #endif
  34.  
  35. //========================================================================================
  36. // Forward declarations
  37. //========================================================================================
  38.  
  39. struct Environment;
  40.  
  41. class ODFrame;
  42. class ODShape;
  43. class ODFacet;
  44.  
  45. //========================================================================================
  46. // Global functions
  47. //========================================================================================
  48.  
  49. // General utils
  50.  
  51. FW_Boolean        FW_IsGXInstalled();
  52.  
  53. void            FW_Priv_GX_Initialize();
  54. void            FW_Priv_GX_Terminate();
  55.  
  56. //========================================================================================
  57. // class FW_CGraphicContextGX
  58. //========================================================================================
  59.  
  60. class FW_CGraphicContextGX
  61. {
  62. // ----- Construction/destruction
  63.  
  64. public:
  65.     FW_DECLARE_AUTO(FW_CGraphicContextGX)
  66.  
  67.                     FW_CGraphicContextGX(
  68.                         Environment* ev,
  69.                         ODFacet* facet,
  70.                         ODShape* invalidShape = NULL);
  71.     virtual            ~FW_CGraphicContextGX();
  72.  
  73. // ----- Drawing
  74.  
  75. public:
  76.  
  77.     void            DrawShape(gxShape shape);
  78.     gxTransform        GetGXTransform() const;
  79.  
  80. // ----- Implementation
  81.  
  82. private:
  83.     gxTransform        fGXTransform;
  84.     gxViewPort        fGXViewPort;
  85.  
  86.     // -----
  87.  
  88.     gxMapping        fMapping;
  89.     gxMapping        fOldMapping;
  90.  
  91.     void            SetupTransformMapping(
  92.                         Environment* ev,
  93.                         ODFacet* facet);
  94.                         
  95.     void            RestoreTransformMapping();
  96.  
  97.     // -----
  98.  
  99.     gxShape            fTransformClipOld;
  100.  
  101.     void            SetupTransformClipping(
  102.                         Environment* ev,
  103.                         ODFacet* facet);
  104.  
  105.     void            RestoreTransformClipping();
  106.  
  107.     // -----
  108.  
  109.     gxShape            fViewPortClipOld;
  110.  
  111.     void            SetupViewPortClipping(
  112.                         Environment* ev,
  113.                         ODFacet* facet,
  114.                         ODShape* invalidShape);
  115.  
  116.     void            RestoreViewPortClipping();
  117. };
  118.  
  119. #endif    // FW_SUPPORT_GX
  120.  
  121. #endif    // FWGXUTIL_H
  122.